package home1;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class test {
    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        Class<Student> sc = Student.class;
        Constructor<Student> constructor = sc.getConstructor(String.class, int.class);
        Student stu1= constructor.newInstance("柳岩", 17);
        Method show = sc.getMethod("show");
        show.invoke(stu1);

    }
}
